#include <iostream>
using namespace std;
const int maxn=205;

int main()
{
	int n=-1,k=-1;
	cin>>n>>k;
	
	int m=0;
	for(int i=0;i<n;++i){
		int tmp=-1,cnt=0;
		while( (cin>>tmp)&&(tmp!=0) )
			++cnt;
		if(cnt>=k)
			++m;
	}
	
	cout<<m<<endl;
	return 0;
}


